package com.woniuxy.controller;

import com.woniuxy.entity.TWork;
import com.woniuxy.mapper.TWorkMapper;
import com.woniuxy.service.HospitalEmployeeManagementsService;
import com.woniuxy.util.PageParam;
import com.woniuxy.util.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 员工管理
 * author：dongHeng
 */

@RestController
@RequestMapping("hospitalEmployee")
public class HospitalEmployeeManagerController {
    @Autowired
    private HospitalEmployeeManagementsService hospitalEmployeeManagementsService;
    @PostMapping("queryTWorkAll")
    public ResponseData<?> queryTWorkAll(@RequestBody PageParam<TWork> pageParam){
        return  hospitalEmployeeManagementsService.queryTWorkAll(pageParam);
    }
    @PostMapping("/updateTWork")
    public  ResponseData<?> updateTWork(@RequestBody TWork tWork){


        return hospitalEmployeeManagementsService.updateTWork(tWork);
    }
    @PostMapping("addTWork")
    public  ResponseData<?> addTWork(@RequestBody TWork tWork){
        return  hospitalEmployeeManagementsService.addTWork(tWork);
    }
    @GetMapping("queryPtAll")
    public ResponseData<?> queryTPtAll(){
        return  hospitalEmployeeManagementsService.queryPt();
    }
    @PostMapping("queryTdeAll")
    public ResponseData<?> queryTdeAll(@RequestBody TWork tWork){
        Integer id=tWork.getWkHdepartmentid();
        return  hospitalEmployeeManagementsService.queryDe(id);
    }
    @PostMapping("queryTrAll")
    public ResponseData<?> queryTrAll(@RequestBody TWork tWork){
        Integer id=tWork.getWkDepartmentid();
        return  hospitalEmployeeManagementsService.queryRole(id);
    }
    @PostMapping("queryByEmpId")
    public  ResponseData<?> queryByEmpId(@RequestBody TWork tWork){
        Integer id=tWork.getId();
        return  hospitalEmployeeManagementsService.queryByEmpId(id);
    }
    @GetMapping("queryRoleAll")
    public  ResponseData <?> queryRoleAll(){
        return hospitalEmployeeManagementsService.queryRoleAll();
    }

}
